<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderCommissionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_commissions', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('用户uid');
            $table->integer('order_id')->default(0)->comment('订单id');
            $table->tinyInteger('type')->default(1)->comment('佣金类型：1买家邀请，2卖家邀请，3vip买家邀请，4vip卖家邀请');
            $table->tinyInteger('money')->default(0)->comment('佣金金额');
            $table->tinyInteger('status')->default(1)->comment('状态：1待处理，2成功，3失败');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_commissions');
    }
}
